package com.ls.lserp.modules.order.dao;


import java.math.BigDecimal;
import java.util.List;

import com.ls.lserp.common.persistence.CrudDao;
import com.ls.lserp.common.persistence.annotation.MyBatisDao;
import com.ls.lserp.dbaccess.Entity.ContractIndentEntity;
import com.ls.lserp.modules.order.entity.AuditInfo;
import com.ls.lserp.modules.order.entity.MaterialPurchase;
import com.ls.lserp.modules.order.entity.OrderMateriel;


/**
  * @ClassName: OrderMateriel
  * @Description: 分类接口
  * 
  * @author 
  * @date 2017年02月20日 
  *
  */

@MyBatisDao
public interface OrderMaterielDao extends CrudDao<OrderMateriel> {
	
	/**
	  * @Title: getEditUnitCostInfo
	  * @Description: 编辑初始化单耗信息取得
	  * @param @param indentId
	  * @param @return
	  * @return OrderMateriel
	  * @throws
	  */
	public OrderMateriel getEditUnitCostInfo(Long id);
	
	/**
	  * @Title: findEditMaterialList
	  * @Description: 编辑初始化物料一览
	  * @param @param id
	  * @param @return
	  * @return List<OrderMateriel> 
	  * @throws
	  */
	public List<OrderMateriel> findEditMaterialList(Long id);
	
	/**
	  * @Title: findMaterialNumList
	  * @Description: 编辑初始化订购物料一览
	  * @param @param id
	  * @param @return
	  * @return List<MaterialPurchase> 
	  * @throws
	  */
	public List<MaterialPurchase> findEditOrderMaterialList(Long id);
	
	/**
	  * @Title: findMaterialNumList
	  * @Description: 核料预定物料数量信息
	  * @param @param id
	  * @param @return
	  * @return List<MaterialPurchase> 
	  * @throws
	  */
	public List<MaterialPurchase> findMaterialReserveList(Long id);
	
	/**
	  * @Title: findIndentList
	  * @Description: 选择合同订单一览
	  * @param @param orderMateriel
	  * @param @return
	  * @return List<OrderMateriel> 
	  * @throws
	  */
	public List<OrderMateriel> findIndentList(OrderMateriel orderMateriel);
	
	/**
	  * @Title: getCreateOrderMaterielInfo
	  * @Description: 新建时获得核料信息
	  * @param @param indentId
	  * @param @return
	  * @return OrderMateriel
	  * @throws
	  */
	public OrderMateriel getCreateOrderMaterielInfo(Long indentId);
	
	/**
	  * @Title: findAllMaterialByStyle
	  * @Description: 通过款式id查找所有物料信息
	  * @param @param orderMateriel
	  * @param @return
	  * @return List<OrderMateriel> 
	  * @throws
	  */
	public List<OrderMateriel> findAllMaterialByStyle(OrderMateriel orderMateriel);
	
	/**
	  * @Title: findContractMeterialList
	  * @Description: 采购合同信息取得
	  * @param @param orderMateriel
	  * @param @return
	  * @return List<OrderMateriel> 
	  * @throws
	  */
	public List<OrderMateriel> findContractMeterialList(OrderMateriel orderMateriel);
	
	/**
	  * @Title: findVenderlList
	  * @Description: 物料供货商一览
	  * @param @param orderMateriel
	  * @param @return
	  * @return List<OrderMateriel> 
	  * @throws
	  */
	public List<OrderMateriel> findVenderlList(OrderMateriel orderMateriel);
	
	/**
	 * 核料辅料表
	 * @param orderMateriel
	 * @return
	 */
	public int insertReserveMaterialS(OrderMateriel orderMateriel);
	
	/**
	  * @Title: getStyleMaterialS
	  * @Description: 款式面辅料表
	  * @param @param orderMateriel
	  * @param @return
	  * @return OrderMateriel
	  * @throws
	  */
	public OrderMateriel getStyleMaterialS(OrderMateriel orderMateriel);
	
	/**
	 * 核料供货商表
	 * @param materialPurchase
	 * @return
	 */
	public int insertMaterialPurchaseS(MaterialPurchase materialPurchase);
	
	/**
	 * 核料预定物料表
	 * @param materialPurchase
	 * @return
	 */
	public int insertMaterialReserveS(MaterialPurchase materialPurchase);
	
	/**
	 * 通过面料ID获取已预订库存
	 * @param materialPurchase
	 * @return
	 */
	public BigDecimal sumMaterialQuantity(OrderMateriel orderMateriel);
	
	/**
	  * @Title: physicallyDeleteReserveMaterialS
	  * @Description: 物理删除所有子项目接口
	  * @param @param orderMateriel
	  * @param @return
	  * @return int 
	  * @throws
	  */
	public int physicallyDeleteReserveMaterialS(Long id);
	
	/**
	  * @Title: updateUnitCost
	  * @Description: 更新大货单号
	  * @param @param orderMateriel
	  * @param @return
	  * @return int 
	  * @throws
	  */
	public int updateUnitCost(OrderMateriel orderMateriel);
	
	/**
	  * @Title: physicallyDeletePurchaseS
	  * @Description: 物理删除所有子项目接口
	  * @param @param orderMateriel
	  * @param @return
	  * @return int 
	  * @throws
	  */
	public int physicallyDeletePurchaseS(Long materialReserveId);
	
	/**
	  * @Title: physicallyDeleteReserveS
	  * @Description: 物理删除所有子项目接口
	  * @param @param orderMateriel
	  * @param @return
	  * @return int 
	  * @throws
	  */
	public int physicallyDeleteReserveS(Long materialReserveId);
	
	/**
	  * @Title: updateOrderMaterialStatus
	  * @Description: 更新核料状态
	  * @param @param orderMateriel
	  * @param @return
	  * @return int 
	  * @throws
	  */
	public int updateOrderMaterialStatus(AuditInfo auditInfo);
	
	/**
	  * @Title: findAllReserverMaterialId
	  * @Description: 物料信息
	  * @param @param id
	  * @param @return
	  * @return List<MaterialPurchase> 
	  * @throws
	  */
	public List<OrderMateriel> findAllReserverMaterialId(Long id);
	
	/**
	  * @Title: reserveMeterialCount
	  * @Description: 通过合同订单，款式，大货单耗,检索核料信息表
	  * @param @param indentId
	  * @param @return
	  * @return OrderMateriel
	  * @throws
	  */
	public List<OrderMateriel> findReserveMeterialP(OrderMateriel orderMateriel);
	
	/**
	  * @Title: reserveMeterialCount
	  * @Description: 通过合同订单，款式，大货单耗,检索核料信息表
	  * @param @param indentId
	  * @param @return
	  * @return OrderMateriel
	  * @throws
	  */
	public int updateIndentStatus(ContractIndentEntity contractIndentEntity);
}
